.trigger_contain {
    position: relative;
    width: 100%; height: 3em;

    .nav_trigger {
        position: absolute;
        top: 50%; left: 1.25em;
        z-index: 9999;
        height: .875em; width: 1.3125em;
        transform: translateY(-50%);

        $bar-width: 1.3125em;
        $bar-height: 2px;
        $bar-spacing: 4px;

        .bar,
        .bar::after,
        .bar::before {
            width: $bar-width;
            height: $bar-height;
        }

        .bar {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            background: $red;
            transition: all 0ms 300ms;

            &.animate {
                background: rgba(255, 255, 255, 0);
            }
        }

        .bar::before {
            content: "";
            position: absolute;
            left: 0;
            bottom: -6px;
            background: $red;
            transition: bottom 300ms 300ms cubic-bezier(0.23, 1, 0.32, 1), transform 300ms cubic-bezier(0.23, 1, 0.32, 1);
        }

        .bar::after {
            content: "";
            position: absolute;
            left: 0;
            top: -6px;
            background: $red;
            transition: top 300ms 300ms cubic-bezier(0.23, 1, 0.32, 1), transform 300ms cubic-bezier(0.23, 1, 0.32, 1);
        }

        .bar.animate::after {
            top: 0;
            transform: rotate(45deg);
            transition: top 300ms cubic-bezier(0.23, 1, 0.32, 1), transform 300ms 300ms cubic-bezier(0.23, 1, 0.32, 1);;
        }

        .bar.animate::before {
            bottom: 0;
            transform: rotate(-45deg);
            transition: bottom 300ms cubic-bezier(0.23, 1, 0.32, 1), transform 300ms 300ms cubic-bezier(0.23, 1, 0.32, 1);;
        }
    }

    @include fl-break(65em) {
        display: none;
    }
}

.sidebar_layout {
    position: relative;

    .sidebar {
        display: flex;
        flex-direction: column;
        overflow: hidden;
        position: fixed;
        z-index: 10;
        top: 0; left: 0;
        width: 4em; height: 100%;
        background: linear-gradient(to top, #ffffff, $light_gray);
        transition: width .4s ease;

        .logo {
            width: 100%;
            display: flex;
            align-items: center;
            padding: 1em;

            .mark {
                transition: margin .3s ease;
            }

            .type {
                opacity: 0;
                width: 0;
                transition: opacity .2s ease, width .2s .1s ease;
            }
        }

        nav {
            flex: 1;
            padding: 0 1em;
            width: 15em;
            overflow: auto;
            -webkit-overflow-scrolling: touch;
            position: sticky;
            top: 10px;

            .navigation_contain {
                display: none;
                transform: translateX(-100%);
                opacity: 0;
                overflow: hidden;
                transition: opacity .3s ease, transform .3s ease;

                ul {
                    list-style-type: none;
                    margin: 0; padding: 0;

                    li {
                        display: block;
                        padding: .65em 0;

                        h2{
                            display: block;
                            font-size: 0.875em;
                            font-weight: 500;
                            color: #090910;
                            text-decoration: none;
                            margin-bottom: 0;
                            cursor: pointer;
                            transition: all 0.3s ease;

                            &:hover {
                                transform: translate3d(5px, 0, 0); // translate3d uses hardware acceleration
                            }
                        }

                        a {
                            display: block;
                            font-size: .875em;
                            font-weight: 500;
                            color: $black;
                            text-decoration: none;

                            &:hover {
                                transform: translate3d(5px, 0, 0); // translate3d uses hardware acceleration
                            }
                        }
                    }

                    ul {
                        overflow: hidden;
                        max-height: 0;
                        transition: max-height .45s ease;

                        li {
                            a {
                                position: relative;
                                padding-left: 1em;
                                font-weight: 400;
                                line-height: 1.25;
                            }

                            &.active a::before {
                                content: "";
                                position: absolute;
                                top: .25em; left: 0;
                                width: .5rem; height: .5rem;
                                background: url(/img/icons/active_marker.min.svg) no-repeat center;
                            }
                        }
                    }

                    li.sub--on {
                        &> h2 {
                            margin-bottom: 1em;
                        }

                        ul {
                            max-height: none;
                        }
                    }
                }
            }
        }
    }

    .nav--on & {
        .sidebar {
            width: 15em;

            .logo {
                .mark {
                    margin-right: 1em;
                    transition: margin .3s .1s ease;
                }

                .type {
                    opacity: 1;
                    width: 7.0625em;
                    transition: opacity .3s .2s ease, width .3s ease;
                }
            }

            nav {
                .navigation_contain {
                    transform: translateX(0);
                    opacity: 1;
                    transition: opacity .5s ease, transform .5s ease;
                }
            }
        }
    }

    .page_contain {
        overflow: hidden;
        padding: 0 5.5% 0 6em;

        .contain {
            padding: 0;
        }
    }

    .body_content {
        padding: 1.25em 0 0;
        min-height: 100vh;

        .doc_section {
            padding: 1.5em 0 1.5em;

            &:first-of-type {
                padding-top: 1em;
            }
        }

        .section_heading {
            position: relative;

            &::before {
                content: "#";
                font-size: .5em;
                position: absolute;
                top: 55%; right: calc(100% + .5em);
                transform: translateY(-50%);
            }
        }
    }

    @include fl-break-height(25em) {
        .sidebar .logo {
            padding: 1.5em 1em;
        }

        .body_content {
            padding-top: 1.75em;
        }
    }

    @include fl-break-height(40em) {
        .sidebar .logo {
            padding: 2em 1em 3.5em;
        }

        .body_content {
            padding-top: 2.25em;
        }
    }

    @include fl-break(40em) {
        .page_contain {
            padding-left: 8.25em;
        }
    }

    @include fl-break(65em) {
        .page_contain {
            overflow: visible;
            padding: 0 5.5%;

            &> .contain {
                display: flex;
                padding: 0 2em;
            }
        }

        .sidebar {
            overflow: visible;
            position: sticky;
            top: 0;
            background: none;
            width: 15em; 
            height: 100vh;

            &::before {
                content: "";
                position: absolute;
                top: 0; right: 0;
                width: 999em; height: 100%;
                background: linear-gradient(to top, #ffffff, $light_gray);
            }

            .logo {
                padding: 1em 0 1em ;

                .mark {
                    margin-right: 1em;
                }

                .type {
                    opacity: 1;
                    width: 7.0625em;
                }
            }

            nav {
                padding: 0;
                transform: translateX(0);
                opacity: 1;

                .navigation_contain {
                    transform: translateX(0);
                    opacity: 1;
                }
            }
        }

        .body_content {
            flex: 1;
            min-width: 0;
            padding-left: 4.25em;

            .doc_section {
                padding: 4em 0 1.5em;
            }
        }

        @include fl-break-height(25em) {
            .sidebar .logo {
                padding: 1.5em 0;
            }
        }

        @include fl-break-height(40em) {
            .sidebar .logo {
                padding: 2em 0 3.5em;
            }
        }
    }
}

.doc_section {
    h5 {
        margin-bottom: 1.222em;
    }
}

.doc_sub_section {
    padding-top: 3.125em;

    :last-child {
        margin-bottom: 0;
    }
}
